// ml:run = $bin < input
#include <iostream>
#include <cmath>
#include <cstring>

template <class T>
T abs(T x) { return x < 0 ? -x : x; }

struct data { double x, y, s, r, d; };
double const eps = 1e-7;
int const maxn = 200;
data da[maxn];
bool vis[maxn];
int n;
double hp;

double dis(double x1, double y1, double x2, double y2)
{
    double x = (x1 - x2) * (x1 - x2);
    double y = (y1 - y2) * (y1 - y2);
    return sqrt(x + y);
}

bool alive()
{
    if (hp < eps) return false;
    std::memset(vis, 0, sizeof(vis));
    double sum = 0;
    double last = 0;
    for (int ti = 0; ti < n; ti++) {
        double xmin = 1e20; int pos = 0;
        bool ok = false;
        for (int i = 0; i < n; i++) {
            if (vis[i]) continue;
            double xi = da[i].x, yi = da[i].y, r = da[i].r;
            if (dis(xi, yi, last, 0) <= r + eps) {
                vis[i] = true;
                hp -= da[i].d;
                sum += da[i].s;
                ok = true;
            }
        }
        if (hp < eps) return false;
        if (ok) continue;

        for (int i = 0; i < n; i++) {
            if (vis[i]) continue;
            double xi = da[i].x, yi = da[i].y, r = da[i].r;
            if (xi > last) {
                if (yi - r <= sum + xi) {
                    double t = sum + da[i].r;
                    double tmp = (xi * xi + yi * yi - t * t) / (2.0 * (t + xi));
                    if (tmp < xmin) { xmin = tmp; pos = i; }
                } else {
                    double t = sum - da[i].r;
                    double tmp = (xi * xi + yi * yi - t * t) / (2.0 * (t + xi));
                    if (tmp < xmin) { xmin = tmp; pos = i; }
                }
            } else {
                double t = sum - da[i].r;
                double tmp = (xi * xi + yi * yi - t * t) / (2.0 * (t + xi));
                if (tmp < xmin) { xmin = tmp; pos = i; }
            }
        }
        if (xmin > 100.0 + eps) return true;
        hp -= da[pos].d;
        if (hp < eps) return false;
        vis[pos] = true;
        sum += da[pos].s;
        last = std::max(last, xmin);
    }
    return true;
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    while (std::cin >> n) {
        for (int i = 0; i < n; i++) {
            std::cin >> da[i].x >> da[i].y >> da[i].s >> da[i].r >> da[i].d;
            da[i].y = abs(da[i].y);
        }
        std::cin >> hp;
        if (alive())
            std::cout << "Safe!\n";
        else
            std::cout << "Danger!\n";
    }
}

